<!-- <template>
    <h1>这是A1</h1>
    <md-viewer :value="mdContent" />

</template>
<script lang="ts" setup>
import MdViewer from '../components/MdView.vue'
import {ref} from 'vue'

const mdContent = ref('jsflkadlkfajdlkfaljfalkdjl\n# 啊啊啊、\nbbbb')
</script> -->

<script setup lang="ts">
import { ref } from 'vue'
import { Editor } from '@bytemd/vue-next'
import gfm from '@bytemd/plugin-gfm'
import 'bytemd/dist/index.css'
import {request} from '../utils/request'

let content = ref('')

const plugins = [gfm()]

const handleChange = (v: string) => {
  content.value = v
}
const hadnleSendBlog = (v:string) => {
  
  request({url: "/api/sendBlog", data: {content: content.value}}).then((r) => {
    
    debugger
  })
}
</script>

<template>
  <main>
    <Editor class="h100" :value="content" :plugins="plugins" @change="handleChange"  />
    <el-button type="primary" @click="hadnleSendBlog">发博文</el-button>
  </main>
</template>

<style scoped>
.h100 /deep/ .bytemd {
    height: 100vh !important;
}

#app {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem;
  font-weight: normal;
}
</style>
